package CS4310.csueb.story;

import CS4310.csueb.characters.Hero;
import CS4310.csueb.items.KeyItem;
import CS4310.csueb.visual.SpriteManager;

/**
 * Creates an objective type where the player is required
 * to collect a specific item.
 *
 * @author Levester Chaney
 *
 */
public class CollectObjective implements Objective
{
	private String description;

	protected CollectObjective(String summary)
	{
		description = summary;
	}

	@Override
	public boolean isComplete(Hero h, SpriteManager s)
	{
		for(KeyItem k : h.getKeyItems())
		{
			if(description.contains(k.toString()))
				return true;
		}
		return false;
	}

	@Override
	public String addStory()
	{
		return "";
	}

	@Override
	public String description()
	{
		return this.description;
	}
}
